There is known a distance measuring device called LIDAR (Light Detection and Ranging, Laser Imaging Detection and Ranging). In this device, an object to be measured is irradiated with pulse light from a light source and scattered light scattered by the object to be measured is detected by a photodetector. A turnaround time of light is longer as a distance from the distance measuring device to the object to be measure, that is, an optical path length is longer. Therefore, the distance can be measured using a time difference between timing when the light source emits the light and timing when the scattered light is detected.
A pulse width, which is a continuous radiation time of the pulse light emitted from the light source, is decided in advance. However, when the photodetector detects the scattered light for a time period longer than a time period corresponding to the pulse width, it is likely that the detection is more strongly affected by environmental light.